package com.foreveross.taskservice.common.application.crawlnode;

import com.foreveross.taskservice.common.bean.AbstractTask;
import com.foreveross.taskservice.common.model.AbstractTaskModel;


/**
 * 抓取节点调度任务的接口
 * @author guokenye
 *
 */
@SuppressWarnings("deprecation")
public interface ICrawlNodeBaseTaskApplication {
	@Deprecated
	public AbstractTask getTaskQueueRecordEntity(Long channelId)throws Exception;
	@Deprecated
	public AbstractTask getTaskQueueRecordEntity(String key,Long channelId)throws Exception;
	@Deprecated
	public AbstractTask[] getTaskQueueRecordEntitys(String key,Long channelId,Integer count)throws Exception; 
	@Deprecated
	public boolean roolbackTaskQueueRecordEntity(AbstractTask task)throws Exception;
	
	
	/**
	 * 提供密钥、任务类型、任务渠道以获得任务
	 * @param key
	 * @param taskType
	 * @param channelId
	 * @return
	 * @throws Exception
	 */
	public AbstractTaskModel getTaskModel(String key,int taskType,long channelId)throws Exception;
	/**
	 * 批量提供密钥、任务类型、任务渠道以获得任务
	 * @param key
	 * @param taskType
	 * @param channelId
	 * @param size
	 * @return
	 * @throws Exception
	 */
	public AbstractTaskModel[] getTaskModels(String key,int taskType,long channelId,int size)throws Exception;
	/**
	 * 回滚任务
	 * @param taskModel
	 * @return
	 * @throws Exception
	 */
	public boolean rollbackTaskModel(AbstractTaskModel taskModel)throws Exception;
	
}
